//
//  XQUnitChange.m
//  JoinPeso
//
//  Created by 小琦 on 2024/11/23.
//

#import "XQUnitChange.h"

@implementation XQUnitChange

+ (NSString *)unitChange:(NSString *)price {
    // 创建一个 NSNumberFormatter 实例
    NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
   
    // 设置数字样式为带有千位分隔符
    [formatter setNumberStyle:NSNumberFormatterDecimalStyle];
   
    // 将整数转换为 NSNumber
    NSInteger pri = [price integerValue];
    NSNumber *number = @(pri);
   
    // 转换为字符串
    NSString *formattedString = [formatter stringFromNumber:number];
    return formattedString;
}

@end
